package com.heima.admin.controller;


import com.heima.admin.service.IWmNewsAuthorService;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/api/v1/news")
@RequiredArgsConstructor
public class WmNewsAuthorController {

    private final IWmNewsAuthorService wmNewsAuthorService;


    @PostMapping("/list_vo")
    @ApiOperation("文章人工审核列表查询")
    public PageResponseResult newsAuth(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsAuthorService.newsAuth(newsAuthDto);
    }


    @GetMapping("/one_vo/{id}")
    @ApiOperation("查询文章详情")
    public ResponseResult queryNewsOne(@PathVariable Integer id ){
        return wmNewsAuthorService.queryNewsOne(id);
    }



    @PostMapping("/auth_fail")
    @ApiOperation("文章审核失败")
    public ResponseResult authFail(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsAuthorService.authFail(newsAuthDto);
    }


    @PostMapping("/auth_pass")
    @ApiOperation("文章审核成功")
    public ResponseResult authPass(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsAuthorService.authPass(newsAuthDto);
    }


}
